home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
PREPARE.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
4KB
|
138 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_Prepare(lUseErrHandler) --> NIL
PARAMETERS:
lUseErrHandler : TRUE or FALSE to use or not use the custom error handler.
SHORT:
Sets various run time envrionments, options, and a custom error handler.
DESCRIPTION:
_Prepare() issues several statement and function calls that are common to all
programs (generally) that use this library as a development platform. It
sets statuses that are commonly used by the other functions in this library
such as _Menu(), _Kmenu() and _FScreen().
An additional feature of this program is that any program using can be
disabled by creating a file in the program directory called @DISABLE.DAT and
then calling this function at the beginning of every program.
If the @DISABLE.!!! file exists, the program is terminated with a message
explaining why. It is handy to control access in a network environment when
users must be prevented from access so that updates can be made.
Additionally, you may include comments in the @DISABLE.!!! file explaining
why the application has been disabled and these comments (ie, the entire
contents of the file) will be displayed on the screen.
_Prepare(), if used in any application, also changes the default errorblock
to use the custom error handling block, bErrorBlock.
This custom error handler logs run time errors in a file specified in a DOS
environment variable ERRFILE on the path specified by a DOS Environment
variable ERRPATH.
Both of these are acceptable DOS environment variable settings:
SET ERRPATH=\ERRORS\
SET ERRPATH=\ERRORS
This is invalid:
SET ERRPATH=\ERRORS\ERRORLOG.TXT
The path setting must contain ONLY a path.
This is an example of the file name specification:
SET ERRFILE=\ERRORLOG.DAT
These are invalid:
SET ERRFILE=\ERRORLOG.TXT
SET ERRFILE=ERRORLOG.TXT\
The ERRFILE must contain ONLY a file name.
If either are not specified, the default is:
ERRPATH : Current directory
ERRFILE : ERRORLOG.TXT
The use of the custom error handler can be disabled by passing FALSE as a
parameter: _Prepare(.F.) This will disable runtime error logging and the
Klipper Error Object.
bErrorBlock is a custom error handling system that records many important
statistics and settings (including the user screen) in an error log file
specified as a parameter to _Prepare(). If not specified, the default file
name is ERRORLOG.TXT. The default location of this file is the current
directory. The location can be changed by setting an OS environment variable
called ERRPATH.
APPLICATION NOTE FILES
----------------------
If a file exists in the current directory named APmmddyy.APN, (where mmddyy
is a date), and the date is todays date, the contents of that file are
presented to the user before the application begins.
These files may be prepared in advance by inserting the appropriate mmddyy
value in APmmddyy.APN. When mmddyy comes around on the calendar, this
Application Note File will be presented to all users each time the system
starts and _Prepare() is called. The note will vanish the next day when the
system date changes.
NOTE:
Use of this function REQUIRES the setting of the U_NAME DOS
Environment Parameter.
EXAMPLE:
_Prepare()
Result:
SCORE is set OFF
COLOR is set to w+/b,w+/g
CURSOR is set OFF
WRAP is set ON
EXCLUSIVE is set OFF
If @DISABLE.!!! is present, the program is terminated and the contents of the
file are displayed on the screen. The disable file name is hard coded in
_Prepare() and may not be changed (unless, of course, you have purchased a
source code liscence - hint hint).
All errors are recorded in a file called ERRORLOG.TXT in the current
directory.
Example 2: (Using an OS Environment Variable (ERRPATH=\LOGFILES)
_Prepare('ERRORS.LST')
Result:
SCORE is set OFF
COLOR is set to w+/b,w+/g
CURSOR is set OFF
WRAP is set ON
EXCLUSIVE is set OFF
Same as above, but all errors are recorded in a file called ERRORS.LST in the
\LOGFILES directory.
******************************************************************************/